﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c="clr-namespace:TFSWorkflowControl.TeamExplorer.WPF">
    <ItemsPanelTemplate x:Key="ItemsPanelTemplate">
        <StackPanel Orientation="Horizontal"
                          VerticalAlignment="Center"
                          HorizontalAlignment="Center"/>
    </ItemsPanelTemplate>
    <DataTemplate DataType="{x:Type c:GroupInfo}">
        <StackPanel Orientation="Vertical">
            <Border  Width="Auto" BorderBrush="#FF000000" BorderThickness="0.5,1,0.5,1"  Margin="0,0,0,2" >
                <Border.Background>
                    <SolidColorBrush   Color="{Binding Color}" />
                </Border.Background>
                <Border>
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#E5FFFFFF" Offset="0"/>
                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock Text="{Binding Path=GroupName}" TextAlignment="Center" Margin="3" HorizontalAlignment="Left"/>
                </Border>
            </Border>         
            <ItemsControl ItemsSource="{Binding Path=StateInfoList}" ItemsPanel="{StaticResource ItemsPanelTemplate}" Padding="3,3,3,3"/>
        </StackPanel>
    </DataTemplate>
    <DataTemplate DataType="{x:Type c:StateInfo}">
        <StackPanel Orientation="Horizontal" Width="Auto">
            <Grid Width="110" Margin="3,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" MinHeight="10"/>
                    <RowDefinition Height="*" MinHeight="10"/>
                    <RowDefinition Height="40" />
                    <RowDefinition MinHeight="10" Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Label Content="{Binding Path=Who}"  Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" Margin="1,-3.3,33,0" FontSize="10" Grid.RowSpan="2" />
                <Label Content="{Binding Path=Date}" ContentStringFormat="d" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="1,0,33,-15" FontSize="9" VerticalAlignment="Center" FontStyle="Normal"/>
                <Label Content="{Binding Path=Reason}"  Grid.Column="0" Grid.Row="3" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center" Margin="1,-20,33,0" FontSize="10"/>
                <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Layer_1" Height="40" Canvas.Left="0" Canvas.Top="0" Grid.Column="0" Grid.Row="2">
                    <Path Canvas.Left="0" Canvas.Top="0" Stretch="Uniform" StrokeThickness="0.5" StrokeLineJoin="Round" Stroke="#FF444444" Data="F1 M 7.41574,32.9125L 84.6913,32.9125L 84.6913,20.9879L 114.532,40.245L 84.6913,59.502L 84.6913,47.5774L 7.41574,47.5774L 7.41574,32.9125 Z ">
                        <Path.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFAFB5B1" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                            </LinearGradientBrush>
                        </Path.Fill>
                        <Path.Effect>
                            <DropShadowEffect Opacity="0.2" ShadowDepth="3"/>
                        </Path.Effect>
                    </Path>
                </Canvas>
            </Grid>
            <Border Margin="3,7,3,7" Width="Auto" BorderBrush="#FF298CA6" BorderThickness="0.5" CornerRadius="8,8,8,8">
                <Border.Effect>
                    <DropShadowEffect Opacity="0.2" RenderingBias="Performance" ShadowDepth="3"/>
                </Border.Effect>
                <Border.Background>
                    <LinearGradientBrush StartPoint="0.973096,0.993378" EndPoint="2.57682,0.993378">
                        <LinearGradientBrush.RelativeTransform>
                            <TransformGroup>
                                <SkewTransform CenterX="0.973096" CenterY="0.993378" AngleX="3.69522" AngleY="0"/>
                                <RotateTransform CenterX="0.973096" CenterY="0.993378" Angle="226.848"/>
                            </TransformGroup>
                        </LinearGradientBrush.RelativeTransform>
                        <LinearGradientBrush.GradientStops>
                            <GradientStop Color="{Binding Path=Color}" Offset="0"/>
                            <GradientStop Color="#FFFFFFFF" Offset="1"/>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Border.Background>
                <Label Content="{Binding Path=Name}" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Normal" FontStretch="Normal" FontStyle="Normal" Margin="3,0,3,0" FontSize="14" />
            </Border>
        </StackPanel>
    </DataTemplate>
</ResourceDictionary>